package cate.common.table.throne.sacrifice;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import easy.java.dev.note.NoteClass;

@NoteClass("刷新次数")
public class KingSacrificeRefreshRow extends ERow {

	private int free;

	private int pay;

	private int pFree;

	private int pPay;

	public String refreshCost;

	@Override
	public void parse(XSSFRowWrap xrw) {
		super.parse(xrw);
		this.id = xrw.getInteger("ID", -1);
		this.free = xrw.getInteger("免费次数",0);
		this.pay = xrw.getInteger("付费次数",0);
		this.pFree = xrw.getInteger("特权免费次数",0);
		this.pPay = xrw.getInteger("特权付费次数",0);
		this.refreshCost = xrw.getString("刷新消耗");
	}

	public int getTotalFree(boolean hasPrivilege) {
		if (hasPrivilege) {
			return free + pFree;
		} else {
			return free;
		}
	}

	public int getTotalPay(boolean hasPrivilege) {
		if (hasPrivilege) {
			return pay + pPay;
		} else {
			return pay;
		}
	}
}
